<?php

	class Transaction_controller extends CI_Controller{

		function __construct(){
			parent::__construct();
			$this->data['logged_email'] = $this->session->userdata('logged_email');
		}

		function index(){
                    $this->session->set_userdata('current_url', selfURL());
			// Your own code here
                    $this->data['section'] = 'transaction';

                    $cfer = new Cfer(array(
                    'Dashboard' => 'dashboard',
                    'Transactions' => base_url('transaction')));
                    
                    $filter = array();
                    $filter['name'] = $this->input->post('name') ? $this->input->post('name') : "";
                    $filter['id_transaction'] = $this->input->post('id_transaction');
                    $filter[PAGINATION_QUERY_STRING_SEGMENT] = $this->input->get(PAGINATION_QUERY_STRING_SEGMENT);
                    $transaction =new Transaction();
                    $transaction = Transaction::getList($filter);
                    $transaction->addSelect("code,name,description,type,amount,
                        date,status,src_acc,dest_acc");
                    $transaction->orderBy("name ASC");
                    $transaction->find();
                    
                    $array_menus = array();
                    $filter = array();
                    $filter['parent_id'] = 0;
                    $filter['type'] = 1;
                    
                    $this->data["transaction"] = $transaction;
                    $this->data["cfer"] = $cfer;
                    $this->data["filter"] = $filter;
                    $this->data["pagination"] = $transaction->pagination;
                    
                    //$filter = array();
                    
                    

                    $this->load->view('main', $this->data);
		}

		// You can place some more methods code here

	}
